import { createStore } from 'redux'

const initState = {
  bannerList: [],
  proList: []
}
// payload 载荷 -- 参数
const reducer = (state = initState, { type, payload }) => {
  switch (type) {
    case 'UPDATE_BANNER_LIST':
      return { ...state, bannerList: payload }
    case 'UPDATE_PRO_LIST':
      return { ...state, proList: payload }
    default:
      return state
  }
}

const store = createStore(reducer)

export default store